package com.explorati.design_pattern.structural.flyweight.example;

/**
 * color属性是棋子的内部状态，构造函数带参数对color赋值，并实现落子方法
 * @author explorati
 *
 */
public class ChesspieceFlyweight implements Chesspiece {
	
	private String color;

	public ChesspieceFlyweight(String color) {
		this.color = color;
	}

	@Override
	public void put(int x, int y) {
		System.out.println("在(" + x + ", " + y + ")位置放了一个" + color + "子");
	}

}
